﻿namespace Taobao.Model
{
    using Castle.ActiveRecord;
    using System;
    using System.Collections.Generic;

    [ActiveRecord]
    public class Shop : ActiveRecordBase<Shop>
    {
        private string _appKey;
        private string _appSecret;
        private string _name;
        private IList<Refund> _refunds;
        private Taobao.Model.Sender _sender;
        private short _shopId;
        private IList<Trade> _trades;
        private DateTime _updated;

        [Property(ColumnType="String")]
        public virtual string AppKey
        {
            get
            {
                return this._appKey;
            }
            set
            {
                this._appKey = value;
            }
        }

        [Property(ColumnType="String")]
        public virtual string AppSecret
        {
            get
            {
                return this._appSecret;
            }
            set
            {
                this._appSecret = value;
            }
        }

        [Property(ColumnType="String")]
        public virtual string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                this._name = value;
            }
        }

        [HasMany(typeof(Refund), Lazy=true)]
        public virtual IList<Refund> Refunds
        {
            get
            {
                return this._refunds;
            }
            set
            {
                this._refunds = value;
            }
        }

        [OneToOne]
        public virtual Taobao.Model.Sender Sender
        {
            get
            {
                return this._sender;
            }
            set
            {
                this._sender = value;
            }
        }

        [PrimaryKey(PrimaryKeyType.Native, ColumnType="Int16")]
        public virtual short ShopId
        {
            get
            {
                return this._shopId;
            }
            set
            {
                this._shopId = value;
            }
        }

        [HasMany(typeof(Trade), Lazy=true)]
        public virtual IList<Trade> Trades
        {
            get
            {
                return this._trades;
            }
            set
            {
                this._trades = value;
            }
        }

        [Property(ColumnType="DateTime")]
        public virtual DateTime Updated
        {
            get
            {
                return this._updated;
            }
            set
            {
                this._updated = value;
            }
        }
    }
}

